#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

bool cmp(pair<int,int> a,pair<int,int> b){
    if(a.second==b.second)return a.first<b.first;
    else return a.second<b.second;
}

void solve(){
    int n;
    cin>>n;
    vector<pair<int,int>> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i].second;
        v[i].first=i+1;
    }
    sort(v.begin(),v.end(),cmp);
    for(int i=0;i<n;i++){
        if(i>0)cout<<" ";
        cout<<v[i].first;
    }
    cout<<endl;
    ll totime=0;
    ll ctime=0;
    for(int i=0;i<=n-1;i++){
        ctime+=v[i].second;
        if(i<n-1)totime+=ctime;
    }
    cout<<fixed<<setprecision(2)<<1.0*totime/n<<endl;
    return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    solve();

    return 0;
}